# 求1 + 2 + 3 + 4 + ...
# theSum = 0
# for i in range(1,101):
#     theSum += i
# print(f'sum={theSum}')

#可以快速修改代码
#使用shift+f6

#continue 立即结束当次循环，进入下一次循环
#break    立即结束整个循环
#
# for i in range(1,6):
#     if i == 3:
#         continue
#     if i == 4:
#         break
#     print(f'吃第{i}个包子')

#求平均值
theSum = 0
count = 0
while True:
    num = input('请输入一个数字:')
    if num == ';':
        break
    num = float(num)
    theSum += num
    count += 1
#计算平均值
print(f'平均值={theSum/count}')


